package org.firebug.spring.boot.apollo.consumer.controller;

import org.firebug.spring.boot.dubbo.api.service.ICalcService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/calc")
public class CalcController {
    @Resource
    private ICalcService calcService;

    @RequestMapping("/add")
    public int add(int a, int b) {
        return calcService.add(a, b);
    }

    @RequestMapping("/sub")
    public int sub(int a, int b) {
        return calcService.sub(a, b);
    }

    @RequestMapping("/mul")
    public int mul(int a, int b) {
        return calcService.mul(a, b);
    }

    @RequestMapping("/div")
    public int div(int a, int b) {
        return calcService.div(a, b);
    }
}
